package observer_pattern;

/**
 * @author: 叶子
 * @date: 2022/06/30 23:04
 * 第三步：创建实体观察者类
 **/
public class OctalObserver extends Observer {
    public OctalObserver(Subject subject) {
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("Octal String:" +
                Integer.toOctalString(subject.getState()));
    }
}